package com.example.Spring.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Order(2)
@Slf4j
@Aspect
//@Component
public class AspectDemo3 {
        @Pointcut("execution(* com.example.Spring.controller.*.*(..))")
        public void pt(){

        }
        @Before("pt()")
        public void doBefore(){
            log.info("执行AspectDemo3的Before方法");
        }
        @After("pt()")
        public void doAfter(){
            log.info("执行AspectDemo3的After方法");
        }
}
